import { Request, Response } from "express"

export function Logger(name:string="logger") {
    return function(req:Request, res:Response, next:any){
        console.log(`middleware ${name}, url: ${req.url}`)
        // res.on('finish', () => {
        //     console.log(`middleware ${name} finish triggered`)
        // })
        next()
        console.log(`middleware ${name} finished`)
    }
}